package com.sylingd.blog.lib

import android.content.Context
import com.bumptech.glide.Glide
import com.bumptech.glide.GlideBuilder
import com.bumptech.glide.Registry
import com.bumptech.glide.annotation.GlideModule
import com.bumptech.glide.module.AppGlideModule
import com.bumptech.glide.integration.okhttp3.OkHttpUrlLoader
import com.bumptech.glide.load.model.GlideUrl
import com.sylingd.blog.BaseApplication
import java.io.InputStream


@GlideModule
class GlideConfiguration: AppGlideModule() {
	override fun registerComponents(context: Context, glide: Glide, registry: Registry) {
		//进度条
		registry.replace(GlideUrl::class.java, InputStream::class.java, OkHttpUrlLoader.Factory(BaseApplication.mOkHttpClient))
	}

	override fun isManifestParsingEnabled(): Boolean {
		return false
	}
}